import java.util.*;

public class HashMapTest {
	public static void main(String[] args) {
		HashMap hm =  new HashMap();
		System.out.println(hm.put("aaa", "111"));
		System.out.println(hm.put("bbb", "222"));
		System.out.println(hm.put("aaa", "444"));
		System.out.println(hm.put("ccc", "333"));
		System.out.println(hm.put("ccc", null));
		
		System.out.println("HashMap size : " + hm.size());
		
		Set set = hm.keySet();
		Object []hmKeys = set.toArray();
		for (int i = 0; i < hmKeys.length; i++) {
			String key = (String)hmKeys[i];
			System.out.print(key);
			System.out.print(" - ");
			System.out.println((String)hm.get(key));
		}
	}
}
